#ifndef __ICANVAS_H_
#define __ICANVAS_H_

#include <cstddef>
#include <IGraphicsItem.h>
#include <ICursorVisual.h>
#include <vector>
#include <MCConstraintsManager.h>

class MCCursorVisual;

class ICanvas
{
public:

    virtual int width() const = 0;
    virtual int height() const = 0;
    virtual double scale() = 0;
    virtual const MCVector2 &offset() = 0;

    virtual void addVisualItem(IGraphicsItem *item) = 0;
    virtual void addCursorVisual(ICursorVisual *cursorVisual) = 0;
    virtual void removeVisualItem(IGraphicsItem *item) = 0;

    virtual IGraphicsItem *itemAt(const MCPoint2D &position) = 0;
    virtual IGripPoint *gripAt(const MCPoint2D &position) = 0;
    virtual std::vector<IGraphicsItem *> items() = 0;
    virtual void resetGrips() = 0;

    virtual MCPoint2D screenToWorld(const MCPoint2D &point) = 0;
    virtual MCPoint2D worldToScreen(const MCPoint2D &point) = 0;

    virtual void setDrawingOffset(const MCVector2 &offset) = 0;
    virtual void setDrawingScale(double scale) = 0;
    virtual void redraw() = 0;

    virtual MCConstraintsManager *constraintManager() = 0;

};

#endif // __ICANVAS_H_
